import request from "@/utils/request";

const EXECUTED_BASE_URL = "/api/v1/executed";

const ExecutedAPI = {
  /** 获取分页数据 */
  getPage(queryParams?: ExecutedPageQuery) {
    return request<any, PageResult<ExecutedPageVO[]>>({
      url: `${EXECUTED_BASE_URL}/page`,
      method: "get",
      params: queryParams,
    });
  },
};

export default ExecutedAPI;

/** 分页查询参数 */
export interface ExecutedPageQuery extends PageQuery {
  /** 主键ID */
  id?: number;
  dbId?: number;
  binlogId?: number;
  startPosition?: number;
  endPosition?: number;
  executedTime?: [string, string];
}

/** 分页对象 */
export interface ExecutedPageVO {
  id?: string;
  dbName?: string;
  binlogId?: number;
  binlogFile?: string;
  startPosition?: number;
  endPosition?: number;
  sqlStatement?: string;
  executedTime?: Date;
}
